<template>
	<view class="home-list-item uflex-a-j_c uflex-a-j_sbc" :class="{'isborder':isborder}" @tap="clickevent">
		<view class="uflex-a-j_fsc">
			<view v-if="item.icon" class="icon iconfont" :class="['icon-' + item.icon]"></view>{{item.name}}
		</view>
		<view class="icon iconfont icon-jinru"></view>
	</view>
</template>

<script>
	export default {
		props:{
			item: Object,
			index: Number,
			isborder: Boolean
		},
		methods:{
			clickevent() {
				switch(this.item.clicktype){
					case 'navigateTo':
						if(this.item.url){
							uni.navigateTo({
								url:this.item.url,
								animationType:"slide-in-right"
							})
						}
						break;
				}
			}
		}
	}
</script>

<style scoped lang="scss">
	.home-list-item{
		padding: 20upx;
		> view{
			&:first-of-type{
				color: #333;
				> view{
					font-size: 40upx;
					padding-right: 10upx;
				}
			}
			&:last-of-type{
				color:#ccc;
			}
		}
	}
	.isborder{
		border-top: 1upx solid #f4f4f4;
		&:last-of-type{
			border-bottom: 1upx solid #f4f4f4;
		}
	}
</style>
